<template>
  <div id="productList">
    <router-link class="listWorp" v-for="(item, index) in productList" :key="index" :class="ulw2" to="">
      <ul :class="[{topic:item.topic}]">
        <li>
          <div class="img">
            <img :src="item.img" alt="">
            <div :class="{bgblue:item.bgBlue,bgred:item.bgRed}" v-if="item.imgText">{{item.imgText}}</div>
          </div>
        </li>
        <li>
          <div class="titleTopic" v-if="item.topic">
            <span class="titleTopicTxt"><i class="left"></i>{{item.title}}<i class="right"></i></span>
            <div class="icoTopic"></div>
          </div>
          <img v-if="item.ico" :src="item.ico">{{item.text}}
        </li>
        <li>
          <div class="assistantTitleTopic" v-if="item.assistantTitle">{{item.assistantTitle}}</div>
          <span class="spell" v-if="item.spell">{{item.spell}}</span>
          <span v-if="item.price" class="price">￥
            <span>{{item.price}}</span>
          </span>
          <span v-if="item.tag" class="tag">{{item.tag}}</span>
          <span class="vipPrice" v-if="item.vipPrice">￥{{item.vipPrice}}</span>
          <span class="vipIco" v-if="item.vipIco"><img :src="item.vipIco"></span>
        </li>
        <li>
          <span class="originalPrice" v-if="item.originalPrice">单购价:￥{{item.originalPrice}}</span>
          <button class="toTopic" v-if="item.toTopic">{{item.toTopic}}</button>
        </li>
      </ul>
    </router-link>
  </div>
</template>

<script>
export default {
  name: 'productList',
  props: ['productList', 'ulw2'],
  data () {
    return {
    }
  }
}
</script>

<style scoped lang="less">
#productList {
  background: rgba(255, 255, 255, 1);
  font-size: 24px; /*px*/
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  .listWorp {
    border: 1px solid rgba(225, 225, 225, 1);
    ul {
      padding: 5px 0;
      li {
        padding: 0 25px; /*px*/
        margin: 10px 0;
      }
      li:nth-of-type(1) {
        text-align: center;
        padding: 25px; /*px*/
        .img {
          position: relative;
          img {
            width: 300px;
          }
          div {
            width: 100%;
            position: absolute;
            bottom: 0px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 18px 20px 10px 0;
            color: rgba(255, 255, 255, 1);
          }
        }
      }
      li:nth-of-type(2) {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        line-height: 36px;
        img {
          margin: -2px 10px 0 0;
          height: 28px; /*px*/
          vertical-align: middle;
        }
      }
      li:nth-of-type(3) {
        display: flex;
        align-items: center;
        color: rgba(255, 0, 0, 1);
        span {
          margin: 0 10px 0 0;
        }
        .price {
          span {
            font-size: 36px; /*px*/
          }
        }
        .tag {
          font-size: 20px; /*px*/
          display: inline-block;
          height: 100%;
          border: 2px solid rgba(255, 0, 0, 1);
          padding: 4px 7px; /*px*/
        }
        .vipPrice {
          color: rgba(100, 100, 100, 0.9);
        }
        .vipIco {
          img {
            vertical-align: middle;
            height: 28px; /*px*/
          }
        }
      }
      li:nth-of-type(4) {
        .originalPrice {
          color: rgba(155, 155, 155, 0.9);
          text-decoration: line-through;
        }
      }
    }
  }
}
.bgblue {
  background: url(../../../../static/image/my/list/bg/bg-blue.png) no-repeat;
  background-size: cover;
}
.bgred {
  background: url(../../../../static/image/my/list/bg/bg-red.png) no-repeat;
  background-size: cover;
}
.ulW2 {
  width: 50%;
}
.topic {
  background: rgba(225, 225, 225, 0.9);
  li {
    margin: 0 0 4px 0; /*px*/
    text-align: center;
  }
  li:nth-of-type(1) {
    .img {
      background: rgba(255, 255, 255, 1);
    }
  }
  li:nth-of-type(2) {
    font-size: 28px; /*px*/
    .titleTopic {
      position: relative;
      width: 100%;
      .titleTopicTxt {
        padding: 0 20px;
        position: relative;
        background: rgba(225, 225, 225, 1);
        z-index: 99;
        i {
          position: absolute;
          display: inline-block;
          width: 10px;
          height: 10px;
          transform: rotate(45deg) translateY(-50%);
          top: 50%;
          background: rgba(255, 155, 155, 1);
        }
        .left {
          left: 0;
        }
        .right {
          right: 0;
        }
      }
      .icoTopic {
        width: 100%;
        height: 1px;
        border-top: 1px solid rgba(255, 155, 155, 1);
        position: absolute;
        top: 50%;
        left: 0;
      }
    }
  }
  li:nth-of-type(3) {
    .assistantTitleTopic {
      color: rgba(155, 155, 155, 0.9);
      font-size: 20px; /*px*/
    }
    justify-content: center;
  }
  li:nth-of-type(4) {
    .toTopic {
      font-size: 20px; /*px*/
      border: 1px solid rgba(55, 55, 55, 1);
      padding: 2px 10px;
      height: 40px;
      border-radius: 20px;
    }
  }
}
</style>
